package com.awakensoftware.hunterserver.transformers;

import org.springframework.stereotype.Component;

import com.awakensoftware.communicationprotocol.contractobjects.chests.ChestContractObject;
import com.awakensoftware.hunterserver.serverentities.Chest;

@Component("chestTransformer")
public class ChestTransformer extends TransformerBase<Chest, ChestContractObject> {

	@Override
	public Chest transformFromContractToServerEntity(ChestContractObject contractObject) {
		Chest serverEntity = super.tryGetExistingServerEntityById(contractObject.getInternalId());
		if (serverEntity == null) {
			serverEntity = new Chest();
		}		
		super.doCompleteTransformFromContractObjectToServerEntity(contractObject, serverEntity);
		return serverEntity;
	}

	@Override
	public ChestContractObject transformFromServerEntityToContractObject(Chest serverEntity) { 		
		ChestContractObject contractObject = new ChestContractObject();
		super.doCompleteTransformFromServerEntityToContractObject(contractObject, serverEntity);
		return contractObject;
	}

	@Override
	protected void doTypeSpecificTransformFromContractObjectToServerEntity(ChestContractObject contractObject,
			Chest serverEntity) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void doTypeSpecificTransformFromServerEntityToContractObject(ChestContractObject contractObject,
			Chest serverEntity) {
		// TODO Auto-generated method stub
		
	}

}
